import java.util.*;

public class Test {
    // 16 进制转化成 10 进制
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            String str = in.next();
            int n = str.length();
            int bit = n - 2 - 1;
            int ret = 0;
            for(int i = 2; i < n; i++){
                int temp = charToInt(str.charAt(i));
                ret += (int)Math.pow(16, bit) * temp;
                bit--;
            }
            System.out.println(ret);
        }
    }

    private static int charToInt(char ch){
        if(ch >= '0' && ch <= '9'){
            return ch - '0';
        }else{
            return ch - 'A' + 10;
        }
    }

    // 还能这么写
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) { // 注意 while 处理多个 case
            String str = in.next();
            System.out.println(Integer.parseInt(str.substring(2), 16));
        }
    }

    // 两数之和
    public int[] twoSum (int[] numbers, int target) {
        Map<Integer, Integer> map = new HashMap<>();
        int n = numbers.length;
        int[] ret = new int[2];
        for(int i = 0; i < n; i++){
            int temp = target - numbers[i];
            if(map.containsKey(temp)){
                ret[1] = i + 1;
                ret[0] = map.get(temp);
                break;
            }else{
                map.put(numbers[i], i + 1);
            }
        }
        return ret;
    }

    // 字符个数统计
    public static void main3(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) { // 注意 while 处理多个 case
            String str = in.next();
            Set<Character> set = new HashSet<>();
            for(char ch : str.toCharArray()){
                set.add(ch);
            }
            System.out.println(set.size()) ;
        }
    }

    // 删除字符串中出现次数最少的字符
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) { // 注意 while 处理多个 case
            String str = in.next();
            int[] alp = new int[26];
            int min = 21;
            for(char ch : str.toCharArray()){
                int index = ch - 'a';
                alp[index]++;
            }
            for(int i = 0; i < 26; i++){
                if(alp[i] != 0 && alp[i] < min ){
                    min = alp[i];
                }
            }
            StringBuilder ret = new StringBuilder();
            for(char ch : str.toCharArray()){
                int index = ch - 'a';
                if(alp[index] > min){
                    ret.append(ch);
                }
            }
            System.out.println(ret.toString()) ;
        }




}
